using Microsoft.Practices.ObjectBuilder2;

namespace Common.Unity
{
	class ObjectCreationStrategy : BuilderStrategy
	{
		public override void PreBuildUp(IBuilderContext context)
		{
			var policy = context.Policies.Get<IObjectCreationPolicy>( context.BuildKey );
			if ( policy != null )
			{
				context.Existing = policy.Create( context );
			}
		}
	}
}